package com.ugoodtech.mdcc.core.repository;

import com.ugoodtech.mdcc.core.domain.StationLeanPaintSatisfactionReport.StationLeanPaintSatisfactionReport;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface StationLeanPaintSatisfactionReportRepository extends PagingAndSortingRepository<StationLeanPaintSatisfactionReport, Long>
        , QueryDslPredicateExecutor<StationLeanPaintSatisfactionReport> {

    @Query("select date_format(max(creation_time),'%Y%m'),improvementTimStr from OperationalDataAnalysis where stationId=:stationId")
    List<Object[]> getMonth(@Param("stationId") Long stationId);



}
